package com.job.action;

import com.job.model.admin.Admin;
import com.job.service.AdminService;

public class AdminAction extends SupperAction {
	private static final long serialVersionUID = 1L;
	private AdminService adminService;
	private Admin admin;
	
	public Admin getAdmin() {
		return admin;
	}
	public void setAdmin(Admin admin) {
		this.admin = admin;
	}
	@javax.annotation.Resource(name="adminService")
	public void setAdminService(AdminService adminService) {
		this.adminService = adminService;
	}
	/**
	 * 
	 */
	public String login() throws Exception {
		admin = this.adminService.findAdminByLogin(admin);
		if(admin!=null){
			this.getSession().setAttribute("loginAdmin", admin);
		}
		return SUCCESS;
		
	}
	public String initMenu() {
		this.admin = (Admin)this.getSession().getAttribute("loginAdmin");
		return SUCCESS;
	}
	
}
